import Vue from 'vue'
import VueRouter from 'vue-router'
import Login from '../views/Login.vue'
import Registers from '../views/Registers'
import Student from '../views/Student'
import ChooseCourse from '../views/ChooseCourse'
import Manager from '@/views/Manager'
import StudentInformation from '@/views/StudentInformation'
import AddStudent from '@/views/AddStudent'
import CourseInformation from '@/views/CourseInformation'
import AddCourse from '@/views/AddCourse'
import TeacherInformation from '@/views/TeacherInformation'
import AddTeacher from '@/views/AddTeacher'
import UpdataStudent from '@/views/UpdataStudent'
import UpdateCourse from '@/views/UpdateCourse'
import UpdateTeacher from '@/views/UpdateTeacher'
import Pay from '@/views/Pay'
import AccountsInformation from '@/views/AccountsInformation'
import FindMoney from '@/views/FindMoney'

Vue.use(VueRouter)

const routes = [
  {
    path: '/manager',
    name: '管理学生',
    component: Manager,
    show: true,
    redirect:"studentInformation",
    children: [
      {
        path: '/studentInformation',
        name: '学生信息',
        show: true,
        component: StudentInformation,
      },
      {
        path: '/addStudent',
        name: '添加学生',
        show: true,
        component: AddStudent,
      },
    ]
  },
  {
    path: '/manager',
    name: "管理课程",
    component: Manager,
    show:true,
    children:[
      {
        path:'/courseInformation',
        name:"课程信息",
        component:CourseInformation,
        show:true
      },
      {
        path:'/addCourse',
        name:"添加课程信息",
        component:AddCourse,
        show:true
      }
    ]
  },
  {
    path: '/Manager',
    name: "管理教师",
    component: Manager,
    show:true,
    children:[
      {
        path:'/teacherInformation',
        name:"教师信息",
        component:TeacherInformation,
        show:true
      },
      {
        path:'/addTeacher',
        name:"添加教师",
        component:AddTeacher,
        show:true,
      }
    ]
  },
  {
    path : '/Manager',
    name: '管理账目',
    component: Manager,
    show: true,
    children: [
      {
        path: '/accountsInformation',
        name: '查看账目表',
        component: AccountsInformation,
        show: true,
      },
      {
        path: '/findMoney',
        name: '催收费用',
        component: FindMoney,
        show: true
      }
    ]
  },
  {
    path: '/choose',
    name: '报名缴费',
    show: false,
    component: Student,
  },
  {
      path: '/chooseCourse',
      name: '选择课程',
      show: false,
      component: ChooseCourse,
  },
  {
    path : '/pay',
    name: '缴费',
    show: false,
    component: Pay
  },
  {
    path: '/',
    name: 'home',
    show: false,
    component: Login,
  },
  {
    path: '/register',
    name: 'register',
    show: false,
    component: Registers,
  },
  {
    path: '/update',
    name: 'updateStudent',
    show: false,
    component: UpdataStudent
  },
  {
    path: '/update1',
    name: 'updateCourse',
    show: false,
    component: UpdateCourse
  },
  {
    path: '/update2',
    name: '/updateTeacher',
    show: false,
    component: UpdateTeacher
  }
]


const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
